<template>
  <mt-tabbar v-model="selected" fixed>
      <mt-tab-item id="recycle" href="#/home">
        <span slot="icon" class="tabbar-icon tabbar-icon-1"></span>
        回收
      </mt-tab-item>
      <!--<mt-tab-item id="activity" href="#/test">-->
        <!--<span slot="icon" class="tabbar-icon tabbar-icon-2"></span>-->
        <!--活动-->
      <!--</mt-tab-item>-->
      <!--<mt-tab-item id="mall" href="#/test">-->
        <!--<span slot="icon" class="tabbar-icon tabbar-icon-3"></span>-->
        <!--商城-->
      <!--</mt-tab-item>-->
      <mt-tab-item id="personal-center" href="#/personal-center">
        <span slot="icon" class="tabbar-icon tabbar-icon-4"></span>
        我的
      </mt-tab-item>
  </mt-tabbar>
</template>

<script>
  import { Tabbar, TabItem } from 'mint-ui'

  export default {
    name: 'tabbar',
    components: {
      [Tabbar.name]: Tabbar,
      [TabItem.name]: TabItem
    },
    data () {
      return {
      }
    },
    props: [
      'parentSelected'
    ],
    computed: {
      selected: {
        get: function () {
          return this.parentSelected.toString()
        },
        set: function () {
          return
        }
      }
    }
  }
</script>

<style lang="scss">
  @import "../../styles/config";
  .mint-tabbar {
    > .mint-tab-item {
      padding: 4px 0;
      background-color: $white;

      &.is-selected {
        color: $c-orange;
        background-color: $white;

        .mint-tab-item-icon {
          @for $i from 1 through 4 {
            .tabbar-icon-#{$i} {
              background: url("../../images/tabbar-icon-on-#{$i}.png") no-repeat center center;
              background-size: 100% 100%;
            }
          }
        }
      }
    }
  }

  .mint-tab-item-icon {
    width: 20px;
    height: 20px;
    @for $i from 1 through 4 {
      .tabbar-icon-#{$i} {
        background: url("../../images/tabbar-icon-#{$i}.png") no-repeat center center;
        background-size: 100% 100%;
      }
    }
  }
</style>
